3.1.9 \(\int \frac {\sec ^5(x)}{i+\cot (x)} \, dx\) [9]

Optimal. Leaf size=40 \[ \frac {1}{8} i \tanh ^{-1}(\sin (x))+\frac {\sec ^3(x)}{3}+\frac {1}{8} i \sec (x) \tan (x)-\frac {1}{4} i \sec ^3(x) \tan (x) \]

[Out]

1/8*I*arctanh(sin(x))+1/3*sec(x)^3+1/8*I*sec(x)*tan(x)-1/4*I*sec(x)^3*tan(x)

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.615, Rules used = {3599, 3187, 3186, 2686, 30, 2691, 3853, 3855} \begin {gather*} \frac {\sec ^3(x)}{3}+\frac {1}{8} i \tanh ^{-1}(\sin (x))-\frac {1}{4} i \tan (x) \sec ^3(x)+\frac {1}{8} i \tan (x) \sec (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[x]^5/(I + Cot[x]),x]

[Out]

(I/8)*ArcTanh[Sin[x]] + Sec[x]^3/3 + (I/8)*Sec[x]*Tan[x] - (I/4)*Sec[x]^3*Tan[x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3186

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*sin[c + d*x]^n*(a*cos[c + d*x] + b*sin[c +
 d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IGtQ[p, 0]

Rule 3187

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_), x_Symbol] :> Dist[a^p*b^p, Int[(Cos[c + d*x]^m*Sin[c + d*x]^n)/(b*Cos[c + d*x] + a*Sin
[c + d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[a^2 + b^2, 0] && ILtQ[p, 0]

Rule 3599

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Sin[e + f*x]^
m*((a*Cos[e + f*x] + b*Sin[e + f*x])^n/Cos[e + f*x]^n), x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
 ILtQ[n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\sec ^5(x)}{i+\cot (x)} \, dx &=-\int \frac {\sec ^4(x) \tan (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int \sec ^4(x) (-i \cos (x)-\sin (x)) \tan (x) \, dx\\ &=i \int \left (-i \sec ^3(x) \tan (x)-\sec ^3(x) \tan ^2(x)\right ) \, dx\\ &=-\left (i \int \sec ^3(x) \tan ^2(x) \, dx\right )+\int \sec ^3(x) \tan (x) \, dx\\ &=-\frac {1}{4} i \sec ^3(x) \tan (x)+\frac {1}{4} i \int \sec ^3(x) \, dx+\text {Subst}\left (\int x^2 \, dx,x,\sec (x)\right )\\ &=\frac {\sec ^3(x)}{3}+\frac {1}{8} i \sec (x) \tan (x)-\frac {1}{4} i \sec ^3(x) \tan (x)+\frac {1}{8} i \int \sec (x) \, dx\\ &=\frac {1}{8} i \tanh ^{-1}(\sin (x))+\frac {\sec ^3(x)}{3}+\frac {1}{8} i \sec (x) \tan (x)-\frac {1}{4} i \sec ^3(x) \tan (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.65, size = 61, normalized size = 1.52 \begin {gather*} -\frac {1}{48} i \left (6 \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )\right )+\sec ^3(x) (16 i-3 (-3+\cos (2 x)) \tan (x))\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^5/(I + Cot[x]),x]

[Out]

(-1/48*I)*(6*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]]) + Sec[x]^3*(16*I - 3*(-3 + Cos[2*x])*Tan[x]
))

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 115 vs. \(2 (29 ) = 58\).
time = 0.26, size = 116, normalized size = 2.90

method result size
risch \(\frac {3 \,{\mathrm e}^{7 i x}+11 \,{\mathrm e}^{5 i x}+53 \,{\mathrm e}^{3 i x}-3 \,{\mathrm e}^{i x}}{12 \left ({\mathrm e}^{2 i x}+1\right )^{4}}-\frac {i \ln \left ({\mathrm e}^{i x}-i\right )}{8}+\frac {i \ln \left ({\mathrm e}^{i x}+i\right )}{8}\) \(66\)
default \(\frac {i}{4 \left (\tan \left (\frac {x}{2}\right )+1\right )^{4}}+\frac {i \ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{8}+\frac {\frac {1}{3}-\frac {i}{2}}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}+\frac {\frac {1}{2}-\frac {i}{8}}{\tan \left (\frac {x}{2}\right )+1}+\frac {-\frac {1}{2}+\frac {3 i}{8}}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {i \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{8}-\frac {i}{4 \left (\tan \left (\frac {x}{2}\right )-1\right )^{4}}+\frac {-\frac {1}{3}-\frac {i}{2}}{\left (\tan \left (\frac {x}{2}\right )-1\right )^{3}}+\frac {-\frac {1}{2}-\frac {3 i}{8}}{\left (\tan \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {-\frac {1}{2}-\frac {i}{8}}{\tan \left (\frac {x}{2}\right )-1}\) \(116\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^5/(I+cot(x)),x,method=_RETURNVERBOSE)

[Out]

1/4*I/(tan(1/2*x)+1)^4+1/8*I*ln(tan(1/2*x)+1)+(1/3-1/2*I)/(tan(1/2*x)+1)^3+(1/2-1/8*I)/(tan(1/2*x)+1)+(-1/2+3/
8*I)/(tan(1/2*x)+1)^2-1/8*I*ln(tan(1/2*x)-1)-1/4*I/(tan(1/2*x)-1)^4-(1/3+1/2*I)/(tan(1/2*x)-1)^3-(1/2+3/8*I)/(
tan(1/2*x)-1)^2-(1/2+1/8*I)/(tan(1/2*x)-1)

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 167 vs. \(2 (26) = 52\).
time = 0.30, size = 167, normalized size = 4.18 \begin {gather*} -\frac {-\frac {3 i \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {8 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {21 i \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {24 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} - \frac {21 i \, \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} - \frac {24 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {3 i \, \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}} + 8}{12 \, {\left (\frac {4 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {6 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {4 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {\sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} - 1\right )}} + \frac {1}{8} i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) - \frac {1}{8} i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^5/(I+cot(x)),x, algorithm="maxima")

[Out]

-1/12*(-3*I*sin(x)/(cos(x) + 1) - 8*sin(x)^2/(cos(x) + 1)^2 - 21*I*sin(x)^3/(cos(x) + 1)^3 + 24*sin(x)^4/(cos(
x) + 1)^4 - 21*I*sin(x)^5/(cos(x) + 1)^5 - 24*sin(x)^6/(cos(x) + 1)^6 - 3*I*sin(x)^7/(cos(x) + 1)^7 + 8)/(4*si
n(x)^2/(cos(x) + 1)^2 - 6*sin(x)^4/(cos(x) + 1)^4 + 4*sin(x)^6/(cos(x) + 1)^6 - sin(x)^8/(cos(x) + 1)^8 - 1) +
 1/8*I*log(sin(x)/(cos(x) + 1) + 1) - 1/8*I*log(sin(x)/(cos(x) + 1) - 1)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 123 vs. \(2 (26) = 52\).
time = 3.50, size = 123, normalized size = 3.08 \begin {gather*} -\frac {3 \, {\left (-i \, e^{\left (8 i \, x\right )} - 4 i \, e^{\left (6 i \, x\right )} - 6 i \, e^{\left (4 i \, x\right )} - 4 i \, e^{\left (2 i \, x\right )} - i\right )} \log \left (e^{\left (i \, x\right )} + i\right ) + 3 \, {\left (i \, e^{\left (8 i \, x\right )} + 4 i \, e^{\left (6 i \, x\right )} + 6 i \, e^{\left (4 i \, x\right )} + 4 i \, e^{\left (2 i \, x\right )} + i\right )} \log \left (e^{\left (i \, x\right )} - i\right ) - 6 \, e^{\left (7 i \, x\right )} - 22 \, e^{\left (5 i \, x\right )} - 106 \, e^{\left (3 i \, x\right )} + 6 \, e^{\left (i \, x\right )}}{24 \, {\left (e^{\left (8 i \, x\right )} + 4 \, e^{\left (6 i \, x\right )} + 6 \, e^{\left (4 i \, x\right )} + 4 \, e^{\left (2 i \, x\right )} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^5/(I+cot(x)),x, algorithm="fricas")

[Out]

-1/24*(3*(-I*e^(8*I*x) - 4*I*e^(6*I*x) - 6*I*e^(4*I*x) - 4*I*e^(2*I*x) - I)*log(e^(I*x) + I) + 3*(I*e^(8*I*x)
+ 4*I*e^(6*I*x) + 6*I*e^(4*I*x) + 4*I*e^(2*I*x) + I)*log(e^(I*x) - I) - 6*e^(7*I*x) - 22*e^(5*I*x) - 106*e^(3*
I*x) + 6*e^(I*x))/(e^(8*I*x) + 4*e^(6*I*x) + 6*e^(4*I*x) + 4*e^(2*I*x) + 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{5}{\left (x \right )}}{\cot {\left (x \right )} + i}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**5/(I+cot(x)),x)

[Out]

Integral(sec(x)**5/(cot(x) + I), x)

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 87 vs. \(2 (26) = 52\).
time = 0.40, size = 87, normalized size = 2.18 \begin {gather*} -\frac {3 i \, \tan \left (\frac {1}{2} \, x\right )^{7} + 24 \, \tan \left (\frac {1}{2} \, x\right )^{6} + 21 i \, \tan \left (\frac {1}{2} \, x\right )^{5} - 24 \, \tan \left (\frac {1}{2} \, x\right )^{4} + 21 i \, \tan \left (\frac {1}{2} \, x\right )^{3} + 8 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 3 i \, \tan \left (\frac {1}{2} \, x\right ) - 8}{12 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}^{4}} + \frac {1}{8} i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) + 1\right ) - \frac {1}{8} i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^5/(I+cot(x)),x, algorithm="giac")

[Out]

-1/12*(3*I*tan(1/2*x)^7 + 24*tan(1/2*x)^6 + 21*I*tan(1/2*x)^5 - 24*tan(1/2*x)^4 + 21*I*tan(1/2*x)^3 + 8*tan(1/
2*x)^2 + 3*I*tan(1/2*x) - 8)/(tan(1/2*x)^2 - 1)^4 + 1/8*I*log(tan(1/2*x) + 1) - 1/8*I*log(tan(1/2*x) - 1)

________________________________________________________________________________________

Mupad [B]
time = 0.46, size = 81, normalized size = 2.02 \begin {gather*} \frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,1{}\mathrm {i}}{4}-\frac {\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^7\,1{}\mathrm {i}}{4}+2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^5\,7{}\mathrm {i}}{4}-2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,7{}\mathrm {i}}{4}+\frac {2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{3}+\frac {\mathrm {tan}\left (\frac {x}{2}\right )\,1{}\mathrm {i}}{4}-\frac {2}{3}}{{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}^4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)^5*(cot(x) + 1i)),x)

[Out]

(atanh(tan(x/2))*1i)/4 - ((tan(x/2)*1i)/4 + (2*tan(x/2)^2)/3 + (tan(x/2)^3*7i)/4 - 2*tan(x/2)^4 + (tan(x/2)^5*
7i)/4 + 2*tan(x/2)^6 + (tan(x/2)^7*1i)/4 - 2/3)/(tan(x/2)^2 - 1)^4

________________________________________________________________________________________